package cn.edu.scau.cmi.dengzejun.chapter09;

import java.util.*;

public class Calculate {
	double compute(String s,String format) {
		StringTokenizer analysisOne = new StringTokenizer(s,format);
		double sum = 0;
		double digitItem = 0;
		while(analysisOne.hasMoreTokens()) {
			String str = analysisOne.nextToken();
			System.out.println(str);
			digitItem = Double.parseDouble(str);
			sum += digitItem;
		}
		return sum;
	}
}
